<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import IndexView from './views/IndexView.vue'
import { NMessageProvider, NConfigProvider } from 'naive-ui'
import { darkTheme } from 'naive-ui'
import { useUserStore } from '@/stores/user'
import { onMounted } from 'vue'

const theme = darkTheme
const userStore = useUserStore()

// 在组件挂载时初始化用户状态
onMounted(() => {
  userStore.initializeState()
})
</script>

<template>
  <n-message-provider>
    <n-config-provider :theme="theme">
      <router-view></router-view>
    </n-config-provider>
  </n-message-provider>
</template>

<style>
.container {
  width: 2560px;
  height: 1440px;
  background: #001529;
}
</style>
